<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
    function doCheck(){
        let loginName = document.querySelector("input[name=loginName1]").value;
            if(!loginName || !loginName.trim()) {
                alert("登录名不能为空");
                return false;
            }
            let password = document.querySelector("input[name=password1]").value;
            if(!password || !password.trim()) {
                alert("密码不能为空");
                return false;
            }
            return true;
    }
    </script>
</head>
<body>
    <h3>登录</h3>
    <?php
     $msg=$_REQUEST["msg"] 
     ?>
    <form action="login.php" method="post" onsubmit="return doCheck()">
        <div>
            <label>登录名:<input type="text" name="loginName1"></label><span><?=$msg?></span>
        </div>
        <div>
            <label>密码:<input type="password" name="password1"></label>
        </div>
        <div>
        <input type="submit" value="登录">
        </div>
    </form>
    <div>
        <a href="regPage.php">注册</a>
    </div>
</body>
</html>
